/**
 * 
 */
package com.wll.thread.concurrent.ch02.newFixed;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import com.wll.thread.concurrent.base.LiftOff;

/**
 * @author wull <br/>
 * 
 */
public class TestNewFixed {
	public static void main(String [] args){
		// 有了FixedThreadPool，可以一次性预先执行代价高昂的线程分配，
		// 因此可以限制线程的数量
		ExecutorService exec = Executors.newFixedThreadPool(5);
		for(int i =0;i<5;i++){
			exec.execute(new LiftOff());
		}
		exec.shutdown();
	}
}
